home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group97a.txt / 000103_icon-group-sender _Wed Apr 9 08:34:22 1997.msg < prev    next >
Internet Message Format  |  2000-09-20  |  2KB

  1. Received: by cheltenham.cs.arizona.edu; Wed, 9 Apr 1997 06:35:46 MST
  2. Message-Id: <1.5.4.32.19970409133422.00702988@post.its.mcw.edu>
  3. X-Sender: cdt@post.its.mcw.edu
  4. X-Mailer: Windows Eudora Light Version 1.5.4 (32)
  5. Mime-Version: 1.0
  6. Content-Type: text/plain; charset="us-ascii"
  7. Date: Wed, 09 Apr 1997 08:34:22 -0500
  8. To: Kostas Oikonomou <ko@surya.ho.att.com>, icon-group@cs.arizona.edu
  9. From: Chris Tenaglia <cdt@post.its.mcw.edu>
  10. Subject: Re: Problem with Icon 9.3
  11. Errors-To: icon-group-errors@cs.arizona.edu
  12. Status: RO
  13. Content-Length: 1487
  14.  
  15.  
  16. I think lists are a different kind of data
  17. than strings. I think it has something to
  18. do with pointers and addresses.
  19.  
  20. That's why I do arrays using keys of concatenated
  21. strings.
  22.  
  23.   # The state diagram.
  24.   sd := table([])
  25.   sd["q0,ok"]  := "q1"
  26.   sd["q0,nok"] := "q0"
  27.   sd["q1,nok"] := "q0"
  28.   sd["q1,ok"]  := "q2"
  29.   # q2 is the final state
  30.  
  31. or
  32.  
  33.   # The state diagram.
  34.   sd := table([])
  35.   sd[q0 || "," || ok]  := "q1"
  36.   sd[q0 || "," || nok] := "q0"
  37.   sd[q1 || "," || nok] := "q0"
  38.   sd[q1 || "," || ok]  := "q2"
  39.   # q2 is the final state
  40.  
  41. Chris
  42. At 12:28 PM 4/7/97 -0400, Kostas Oikonomou wrote:
  43. >Hi,
  44. >
  45. >I have the following simple (I think) program:
  46. >
  47. >link ximage
  48. >
  49. >procedure main()
  50. >
  51. >  # The state diagram.
  52. >  sd := table([])
  53. >  sd[["q0","ok"]] := "q1"
  54. >  sd[["q0","nok"]] := "q0"
  55. >  sd[["q1","nok"]] := "q0"
  56. >  sd[["q1","ok"]] := "q2"
  57. >  # q2 is the final state
  58. >
  59. >  every x := key(sd) do write(ximage(x), ":", sd[x])
  60. >
  61. >end
  62. >
  63. >This doesn't behave as I think it should.  The problem seems to be a
  64. >table whose keys are lists.  Is there something wrong with this kind of
  65. >structure?  I don't see anything to that effect in the 3d edition of the
  66. >Icon book, Ch. 6 on tables.
  67. >
  68. >I'd appreciate your help.
  69. >-- 
  70. >                    Kostas Oikonomou
  71. >
  72. >
  73.  
  74. Chris Tenaglia (system manag
  75. r)         |       cdt@post.its.mcw.edu
  76. Medical College of Wisconsin            |
  77. 8701 W. Watertown Plank Rd.             |      Ce que vous voyez est
  78. Milwaukee, WI 53226 (414)456-8765       |      Ce que vous obtenez !
  79.  
  80.